public class Parag {
    public int year;
    public int month;
    public int day;
    public void setDate(int year, int month, int day){  //局部变量与形参名称相同时，一定要加this
                                                        //否则根据就近原则会给形参赋值为
                                                        // 0、null ‘\u0000'、false，实参不会改变
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void print(){
        System.out.println(year + "年" + month + "月" + day + "日");
    }

    public static void main(String[] args) {
        Parag p = new Parag();
        p.setDate(2004,07,01);
        p.print();
    }
}
